﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace wordFrequency
{
    public partial class MyChoseFile : UserControl
    {
        public MyChoseFile()
        {
            InitializeComponent();
        }
        //返回文本框与选择对话框
        public OpenFileDialog DialogChoseFile
        {
            get { return this.openFileDialog; }
        }
        public TextBox TxtChoseFile
        {
            get { return this.txtChoseFile; }
        }
        //选择的文本名
        public string FileName
        {
            get { return this.txtChoseFile.Text; }
        }

        public string FileFilter {
            get { return openFileDialog.Filter; }
            set { openFileDialog.Filter = value; }
        }                                                                                                                                                                                                                                                                                                              
             
        private void btnOpen_Click(object sender, EventArgs e)
        {
            this.openFileDialog.ShowDialog();
            this.txtChoseFile.Text = openFileDialog.FileName;
        }
    }
}
